const Router = require('koa-router');

//控制器
const { getAll, getPaster, exchange, getIntegral, getTeacup } = require('../controller/paster.controller');

//中间件
const { auth } = require('../middleware/auth.middleware');
const { validator } = require('../middleware/validator.middleware');

const router = new Router({ prefix: '/paster' });

//获取积分商城贴纸
router.get('/get', auth, getAll);

//获取用户账户贴纸
router.get('/get/:pasterType', auth, getPaster);

//用户兑换贴纸
router.post('/exchange', auth, validator({ paster_id: 'number' }), exchange);

//获取用户积分
router.get('/getIntegral', auth, getIntegral);

//获取茶具信息
router.get('/teaCup', auth, getTeacup);

module.exports = router;